package org.niux.aims.action;

import javax.annotation.Resource;

import org.niux.aims.common.web.AimsBaseAction;
import org.niux.aims.service.IAccountService;
import org.niux.aims.service.IApplicationService;
import org.niux.aims.service.IEntitysService;
import org.niux.aims.service.ILogsService;
import org.niux.aims.vo.AccountVO;

/**
 * 
 * Copyright (c) 2009,niux<br>
 * All rights reserved.<br>
 * 
 * 文件名称：WorkTableAction.java<br>
 * 摘    要：工作台首页页面类<br>
 * <br>
 * 当前版本：<br>
 * 作    者：铭显 Email: <a href="mailto:liangmingxian@gmail.com">liangmingxian@gmail.com</a><br>
 * 完成日期：@since 2013-8-1<br>
 * <br>
 * 取代版本：<br>
 * 原作者  ：<br>
 * 完成日期：@since Oct 22, 2009<br>
 */
public class WorkTableAction extends AimsBaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2421032174952752245L;
	
	@Resource(name="applicationService")
	private IApplicationService applicationService;
	
	@Resource(name="accountService")
	private IAccountService accountService;
	
	@Resource(name="entityService")
	private IEntitysService entityService;
	
	@Resource(name="logsService")
	private ILogsService logsService;

	/**
	 * 
	 * 方法概述：页面渲染
	 * 描述：页面渲染
	 * @return
	 * 返回类型：String
	 * 修改人：梁铭显
	 * 修改时间：2013-8-1
	 */
	public String showPage(){
		logsService.addLog("【"+((AccountVO)super.getSession().get("account")).getName()+"】进入工作台");
		
		int appCount = applicationService.findAll().size();
		int accountCount = accountService.findAll().size();
		int entityCount = entityService.findAll().size();
		
		super.getRequest().setAttribute("appCount", Integer.toString(appCount));
		super.getRequest().setAttribute("accountCount", Integer.toString(accountCount));
		super.getRequest().setAttribute("entityCount", Integer.toString(entityCount));
		
		return "success";
	}
}
